<?php
	$lastid = $_GET['lastid'];
	$action = $_GET['action'];
	if($action <> "get")
	{
?>
<script type="text/javascript">
	jQuery(document).ready(function($){
		function last_id_funtion() { 
		    var ID=$(".morebox:last").attr("id");
			$('div#last_id_loader').addClass('loading');
			$.post("templates/load_product.php?action=get&lastid="+ID,
			function(data){
				if (data != "") {
					$(".morebox:last").after(data);			
				}
				$('div#last_id_loader').removeClass('loading');
			});
		};
		$(window).scroll(function(){
			if  ($(window).scrollTop() == $(document).height() - $(window).height()){
			   last_id_funtion();
			}
		});
		
	});
	</script>
    <div class="moduleTitle">
		<h3><span><?php if(isset($_GET['mod']) && $_GET['mod'] == "product") echo "Product List"; else echo "Featured Recipes"; ?></span></h3>
	</div>
    <div class="jbmoduleBody">
        <div>
            <div class="zentools grid  zenshadow count5 ">
                <ul>	
                    <div id="updates">
    <?php
		include('product.php');
	?>
					<div id="last_id_loader"></div>

<?php
	}
	else{
		include('ajax_more.php');		
		
	}
?>	
                    </div>
                    <li class="clear"></li>
                </ul>
            </div>
        </div>
    </div>
